﻿using SqlSugar;

namespace ChangchunPublicInfoWebSite.Common;

public static class SqlsugarSetup
{
    public static void AddSqlSugarSetup(this IServiceCollection services, string connectionString)
    {
        var sqlSugar = new SqlSugarScope(new ConnectionConfig()
        {
            DbType = DbType.SqlServer,
            ConnectionString = connectionString,
            IsAutoCloseConnection = true,
        });
        services.AddSingleton<ISqlSugarClient>(sqlSugar);
    }
}
